export default function($scope,service,$state){
    console.log(1);
    service.get($scope.host+"/Common/list/student",'',function(data){
        console.log(data);
        $scope.data=data;
    })
    $scope.showModal=function(item){
        $scope.arr=["stationId",'levelId','majorId','batchId','classesId'];
        service.get($scope.host+"/common/get"+$state.current.url+"/"+item.id,'',function(data){
            console.log(data);
            $scope.selectedCollection={};
            angular.forEach($scope.arr,function(item){
                $scope.selectedCollection[item]=data.data[item].toString();
            })
           $scope.selectedCollection.termId=data.data.termId.toString();
            $scope.modalData=data;
            $("#myModal").modal();
        })
    }
    $scope.change=function(item){
        angular.forEach($scope.arr,function(data,index){
           if(index>$scope.arr.indexOf(item)){
               $scope.selectedCollection[data]="-1";
           }
        })
    }
}